import React from 'react';

import { View, StyleSheet, TextInput, Text } from 'react-native';
import theme from '../native-base-theme/variables';

export default ({ name, value, _onChangeText, placeholder, keyboardType, numberOfLines }) => (
  <View style={styles.container}>
    <View style={{ flex: 1 }}>
      <Text style={styles.fontStyle}>{name}</Text>
    </View>
    <View style={{ flex: 2, flexDirection: 'row', justifyContent: 'flex-end' }}>
      <TextInput
        style={styles.textArea}
        numberOfLines={numberOfLines}
        placeholder={placeholder}
        keyboardType={keyboardType}
        multiline
        onChangeText={(text) => _onChangeText(text)}
        value={value}
        placeholderTextColor="rgba(219,219,219,0.52)"
      />
    </View>
  </View>
);

const styles = StyleSheet.create({
  container: {
    padding: 8,
    flexDirection: 'row',
    flex: 1,
    alignItems: 'center',
  },
  fontStyle: {
    fontSize: theme.myNormalFontSize,
    color: 'white',
  },
  textArea: {
    padding: 4,
    flex: 1,
    color: 'white',
    borderRadius: 2,
    borderWidth: 1,
    borderColor: 'rgba(219,219,219,0.52)',
  },
});
